<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0054)http://technoplaza.suso.org/assembly/index.cgi?p=68ks2 -->
<HTML><HEAD><TITLE>The Stack, Handles, and Errors</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<link href="edit68k.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgColor=#ffffff>
<H1 class="heading">How to Address Variables<br>
    <hr noshade>
</H1>
<P class="text">How do we address things? How do I copy the word stored at var1 to D0? It's very simple, just move.w (var1),d0. As usual, the upper 16 bits are unaffected. How do we make A0 point at str1? Also easy. Just use lea str1(PC),a0. You MUST type (PC) after the label, otherwise it will not work! This is just the way we get the address of a label (see <A 
        href="68ks1e.htm">Effective Addressing</A>) After loading A0 with the pointer to str1, you can get the first byte with move.b (a0)+,d0 This copies the first byte ('H' = 72) to D0 and increases A0 with one, thus pointing to the next character. Here you must use parentheses since else it would mean copy A0, not the byte stored at A0, to D0.</P>
<H4 align=left> </H4>
</BODY>
</HTML>
